$(document).ready(function(){
  $("#list").jqGrid({
   	//url:'sqldata1.php',
	datatype: "json",
   	colNames:['User','Message'],
   	colModel:[
   		{name:'user',index:'id', width:55},
   		{name:'message',index:'invdate', width:90}
   	],
   	rowNum:10,
   	rowList:[5,10,20,30],
   	pager: '#pager',
   	sortname: 'id',
    viewrecords: true,
    sortorder: "desc",
    imgpath: 'jqGrid/themes/basic/images',
    caption:"JSON Example",
    width:725
   });
   jQuery("#list").navGrid('#pager',{edit:true,add:true,del:true});
});
//this code is for testing of the datagrid is working or not!!!!!
/*$(document).ready(function(){
    jQuery("#list").jqGrid({
        url:'example.xml',
        datatype: 'xml',
        mtype: 'GET',
        colNames:['Inv No','Date', 'Amount','Tax','Total','Notes'],
        colModel :[
          {name:'invid', index:'invid', width:55},
          {name:'invdate', index:'invdate', width:90},
          {name:'amount', index:'amount', width:80, align:'right'},
          {name:'tax', index:'tax', width:80, align:'right'},
          {name:'total', index:'total', width:80, align:'right'},
          {name:'note', index:'note', width:150, sortable:false} ],
        pager: jQuery('#pager'),
        rowNum:10,
        rowList:[10,20,30],
        sortname: 'invid',
        sortorder: "desc",
        viewrecords: true,
        imgpath: 'jqGrid/themes/steel/images',
        caption: 'My first grid'
  });

});*/
